<% breadcrumb :invitation_settings %>

<div class="row">
  <div class="col-lg-12">
    <div class="ibox float-e-margins">
      <div class="ibox-title">
        <h5>邀请函设置</h5>
      </div>
      <div class="ibox-content">

        <%= form_for @settings, url: event_update_invitation_settings_path, html: {class: 'form-horizontal'} do |f|%>

          <div class="form-group"><label class="col-sm-2 control-label">邀请函内容</label>
            <div class="col-sm-5"> <%=f.text_area :content, rows: 5, class: 'form-control'%> </div>
          </div>

          <div class="form-group"><label class="col-sm-2 control-label">场次</label>
            <div class="col-sm-5"> <%=f.text_field :event_alias, class: 'form-control'%> </div>
          </div>

          <div class="form-group"><label class="col-sm-2 control-label">会议日期</label>
            <div class="col-sm-3"> <%=f.text_field :date, class: 'form-control'%> </div>
          </div>

          <div class="form-group"><label class="col-sm-2 control-label">会议签到时间</label>
            <div class="col-sm-3"> <%=f.text_field :check_in_time, class: 'form-control'%> </div>
          </div>

          <div class="form-group"><label class="col-sm-2 control-label">会议地点</label>
            <div class="col-sm-5"> <%=f.text_field :location, class: 'form-control'%> </div>
          </div>

          <div class="form-group"><label class="col-sm-2 control-label">地址</label>
            <div class="col-sm-5"> <%=f.text_field :address, class: 'form-control'%> </div>
          </div>

          <div class="form-group"><label class="col-sm-2 control-label">地图链接</label>
            <div class="col-sm-5"> <%=f.text_field :map_url, class: 'form-control'%> </div>
          </div>

          <div class="form-group"><label class="col-sm-2 control-label">短信模板</label>
            <div class="col-sm-5"> <%= text_area_tag :sms_template, @sms_template, rows: 5, class: 'form-control', placeholder: '请与云片短信平台的一致(一字不差)'%> </div>
          </div>

          <div class="form-group"> <label class="col-sm-2 control-label">照片</label>
            <div class="col-sm-3">
              <% if @settings.photo.exists? %>
              <div class="row photo-preview">
                <div class="col-sm-12">
                  <%= image_tag(@settings.photo.url(:thumb))%>
                </div>
                <div class="col-sm-12 m-t-md">
                  <a href="javascript:;" class="btn btn-xs btn-white btn-outline delete-photo-btn">删除照片</a>
                  <a href="javascript:;" class="btn btn-xs btn-white btn-outline re-upload-photo-btn">重新上传</a>
                </div>
                <%= hidden_field_tag '_delete_photo'%>
              </div> <!-- ROW -->
              <% end %>
              <div class="row  <%= @settings.photo.exists? ? 'hidden' : ''%> upload-photo-input">
                <div class="col-sm-12">
                  <%=f.file_field :photo, class: 'form-control'%>
                </div>
              </div>
            </div>
          </div>

          <div class="form-group">
            <div class="col-sm-4 col-sm-offset-2">
              <%=link_to '取消', event_dashboard_path(current_event), class: 'btn btn-white'%>
              <%= button_tag '保存', class: 'btn btn-primary'%>
            </div>
          </div>

        <% end %>


      </div>
    </div>
  </div>
</div>
